﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using Models;

namespace DAL
{
   public class UserInfoDAL
    {
       /// <summary>
       /// 申艳红判断用户是否存在
       /// </summary>
       /// <param name="model">对象</param>
       /// <returns>是否存在</returns>
       public static bool Login(UserInfo model)
       {
           string sql = string.Format("select * from UserInfo where Number='{0}' and PassWord='{1}'", model.Number, model.PassWord);
           DataTable tb = DBHelper.Instance().GetDataTableBySql(sql);
           if (tb != null && Convert.ToInt32(tb.Rows.Count)>0)
           {
               return true;
           }
           else
           {
               return false;
           }
       }
    }
}
